package creational.singleton;

/**
 * 单例模式：饿汉式
 * 在类加载时创建实例，避免了线程安全问题
 * @author Zhang Ziyi
 */
public class SingletonEHan {
    static {
        singletonEHan = new SingletonEHan();
    }

    private static SingletonEHan singletonEHan;

    private SingletonEHan() {
    }

    public static SingletonEHan getInstance() {
        return singletonEHan;
    }
}
